import request from '@/utils/request'

// 查询火车餐订单列表
export function listMealorder(query) {
  return request({
    url: '/boot/mealorder/list',
    method: 'get',
    params: query
  })
}

// 查询火车餐订单详细
export function getMealorder(mealOrderId) {
  return request({
    url: '/boot/mealorder/' + mealOrderId,
    method: 'get'
  })
}

// 新增火车餐订单
export function addMealorder(data) {
  return request({
    url: '/boot/mealorder',
    method: 'post',
    data: data
  })
}

// 修改火车餐订单
export function updateMealorder(data) {
  return request({
    url: '/boot/mealorder',
    method: 'put',
    data: data
  })
}

// 删除火车餐订单
export function delMealorder(mealOrderId) {
  return request({
    url: '/boot/mealorder/' + mealOrderId,
    method: 'delete'
  })
}

// 获取火车餐订单下拉选项列表
export function getMealorderOptions() {
  return request({
    url: '/boot/mealorder/options',
    method: 'get'
  })
}

// 获取当前用户的火车票订单列表
export function getUserTrainOrders() {
  return request({
    url: '/boot/mealorder/userTrainOrders',
    method: 'get'
  })
}

// 根据用户ID获取火车票订单列表
export function getTrainOrdersByUserId(userId) {
  return request({
    url: '/boot/mealorder/trainOrdersByUserId/' + userId,
    method: 'get'
  })
}
